//
//  AlbumCell.m
//  PSYWeiBo
//
//  Created by xiaotian on 16/3/15.
//  Copyright © 2016年 郑亚田. All rights reserved.
//

#import "AlbumCell.h"

@implementation AlbumCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self addAllViews];
    }
    
    return self;
}

- (void)addAllViews {
    self.timeLine = [UILabel new];
    [self addSubview:self.timeLine];
    [self.timeLine mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.bottom.equalTo(@0);
        make.left.equalTo(@34);
        make.width.equalTo(@2);
    }];
    self.timeLine.backgroundColor = [UIColor lightGrayColor];
    
    self.iconImg = [UIImageView new];
    [self addSubview:self.iconImg];
    [self.iconImg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(@15);
        make.centerX.mas_equalTo(self.timeLine.mas_centerX);
        make.width.height.equalTo(@30);
    }];
    self.iconImg.image = [UIImage imageNamed:@"custom-menu-album"];
    self.iconImg.clipsToBounds = YES;
    self.iconImg.layer.cornerRadius = 15;
    
    self.textLab = [UILabel new];
    [self addSubview:self.textLab];
    [self.textLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.iconImg.mas_centerY);
        make.left.equalTo(self.iconImg.mas_right).with.offset(15);
        make.right.equalTo(@-15);
    }];
    self.textLab.text = @"创建了一本名叫【测试】的相册";
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
